Repository navigation
fix: finish waiting SMS calls and cover the rejection paths - #69
Merged
Merged
Conversation
Removing a listener or starting a new SMS call left the waiting Future pending forever. Both now finish it as canceled, and removal is queued behind suspend calls, which start on a later main thread tick. The SMS calls and requestPhoneNumberHint shared one pending result, so an SMS arriving while the hint dialog was open came back as the phone number. They now have separate results. getSmsWithRetrieverApi can now return SmartAuthResult.canceled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add unit tests for the SMS and hint result mapping, and integration tests for denied consent, other senders, unsigned messages, rotation, backgrounding, hint and SMS together, and pending calls. Stop adb from reading stdin in run_sms_tests.sh, where it swallowed the test output the script reads its markers from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4.0.0 has not been released yet, so the fixes belong in that section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without a credential provider on the device, saving a password or creating a passkey fails with TYPE_NO_CREATE_OPTIONS. This was only mentioned for contributors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rotation test timed out on CI. The script rotated back right after tapping, and each rotation recreates the dialog, which may lose the tap. Tap after the rotations instead, and report a missing dialog button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The integration tests covered the happy paths, but not rejection, cancel or concurrent calls. Adding those tests exposed real bugs:
removeSmsRetrieverApiListenerandremoveUserConsentApiListenernever finished the waiting call, so its Future stayed pending forever. Starting a second SMS call did the same to the first.requestPhoneNumberHintshared one pending result. With the hint dialog open, an arriving SMS came back as the phone number (<#> Your code is 888888 ...).suspendfunctions that start on a later main thread tick, while removal ran immediately. Callingremove...Listenerright afterget...did nothing and the call hung.Changes
Plugin
canceled.getSmsWithRetrieverApican now returnSmartAuthResult.canceled.Tests
test/sms_api_test.dart: 13 unit tests for the SMS and hint result mapping, custom and invalid matchers, and calls with no native implementation.run_sms_tests.shadb shellno longer reads stdin. It was swallowing test output, which the script reads its markers from. This bug predates this PR.Behaviour changes
canceled. It's in the 4.0.0 changelog under Fixes.pubspec.yamlis not bumped.await remove...Listener()can return a moment before the waiting call finishes.Verification
Known gap
If a consent dialog is open and a new SMS call starts, the old call finishes as
canceled, but the dialog's result then goes to the new call. Not fixed or tested here.🤖 Generated with Claude Code